/*2：
公司有公司名称，注册地址，电话，经营范围等属性，公司有很多员工（用List存储），
员工有姓名，年龄，性别，职务，薪水、工号等属性，公司有招聘员工（要求工号不能重复），
有输出员工信息，以及辞退员工，和统计公司人数的方法
用oo的思想模拟*/
package Work0528;

import java.util.Scanner;

public class CompanyTest {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		Company test = new Company("黑猪", "淝南家园北区", 16666694666l, "开发和推广");
		test.show();
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>");

		test.addStaff("黑猪", 22, "男", "经理", 200000, 001);
		test.addStaff("伊藤博文", 22, "男", "顾问", 199999, 002);
		while (true) {
			System.out.println("1.招聘员工  2.输出员工信息  3.辞退员工  4.统计公司人数  5.加薪6.退出");
			System.out.print("请选择:");
			int num = in.nextInt();
			if (num == 1) {
				System.out.println("请输入员工姓名:");
				String name = in.next();
				System.out.println("请输入员工年龄:");
				int old = in.nextInt();
				System.out.println("请输入员工性别:");
				String sex = in.next();
				System.out.println("请输入员工职位:");
				String post = in.next();
				System.out.println("请输入员工薪水:");
				int salary = in.nextInt();
				System.out.println("请输入员工工号:");
				int jobNo = in.nextInt();
				boolean q = test.addStaff(name, old, sex, post, salary, jobNo);
				System.out.println(q ? "添加成功" : "失败!工号重复");
				System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>");

			} else if (num == 2) {
				test.showStaff();
				System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>");

			} else if (num == 3) {

				System.out.println("请输入员工工号:");
				int jobNo = in.nextInt();
				boolean w = test.dismissal(jobNo);
				System.out.println(w ? "辞退成功" : "该员工不存在");
				System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>");

			} else if (num == 4) {
				System.out.println("公司总人数为" + test.statistics());
				System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>");

			} else if (num == 5) {

			} else if (num == 6) {
				break;
			} else {
				System.out.println("重新输入");
				System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>");
			}
		}
	}

}
